package chapter_7;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Test11 {
    public static void main(String[] args) throws Exception{
        FileOutputStream fos = new FileOutputStream("D:\\buf.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        bos.write(97);
        bos.write(98);
        bos.write(99);
        bos.close();

        FileInputStream fis = new FileInputStream("D:\\buf.txt");
        BufferedInputStream bis = new BufferedInputStream(fis);
        System.out.println((char)bis.read());
        System.out.println((char)bis.read());
        System.out.println((char)bis.read());
//        int available = bis.available();
//        byte[] bytes = new byte[available];
//        bis.read(bytes);
//        System.out.println(new String(bytes));
        bis.close();
    }
}
